<?php $this->load->view('flyguam/_header') ?>
<script language="javascript" type="text/javascript" src="<?php echo site_url('js/flight.js')?>"></script>

<div class="Main" style="width:622px">	
	<div class="flightbox1" style="background:#fff;width:100%;">
		Reference NO:<?php echo $sOrderno?>
		<span style="width:220px"></span>
		<?=lang("OrderStatus1")?>:<?=$OrderStatusDesc?>
	</div>
	<div class="flightbox1" style="width:100%;">&nbsp;&nbsp;
		<?=lang("home_From")?>:<?php echo $sFromcity?><span style="width:35px;"></span>
		<?=lang("home_To")?>:<?php echo $sDestcity?><span style="width:35px"></span>
		<?=lang("home_Depart")?>Date:<?php echo $sDepartDate?><span style="width:35px"></span>
		<?=lang('home_Return')?>:<?php echo $sReturnDate;?>
	</div>
	<div id="dvmainflight" style="padding:4px 0 0 4px;width:100%;">
	<table border=0 width=100% >
		<tr height=34 class="trair" align=center>
			<td width=85 ><?=lang("home_Depart")?></td>
			<td width=120 ><?=lang("FlightNo/Airline")?></td>
			<td width=120 ><?=lang("Depart/Arrival")?></td>
			<td width=70 ><?=lang("Class")?></td>
			<td width=80 >Plane Type</td>
			             
			<td width=90  ><?=lang("Fare")?></td>
			<td width=78 ><?=lang("Tax&Fee")?></td>

			<td width=90  ><?=lang("TotalPrice")?></td>
		</tr><?php
		$maxseat=1;
		foreach($arairinfo as $item)
		{
		?><tr height=55 class="trdash" align=center>
			<td><?=Date("Y-m-d",strtotime($item["flightdate"]));?></td>
			<td align=left style="padding-left:5px" ><?php echo "<img style=\"float:left\" width=25 height=25 src=\"".site_url("images/airlines/".$item["Airline"].".gif")."\" alt='".$item["Airline"]."' />".$item["FlightNo"] ?></td>
			<td align=left nowrap ><?php echo $item["Depart"]."&nbsp;".$item["fromportName"].'<br/>'.$item["Arrival"]."&nbsp;".$item["destportName"]; ?></td>
			<td><?php echo $item["class"][0][0]; ?></td>
			<td><?php echo $item["Plane"]; ?></td>
			
			<td><?php
			$itotalprice=0;
			$itotalprice=$item["cost"];
			$maxseat	=$item["class"][0][1];	
			echo $item["class"][0][2];
			
			//计算总价
			$itotalprice+=$item["OilFee"]+$item["AirportFee"];
			?></td>
			<td><?php echo $item["OilFee"]."+".$item["AirportFee"]; ?></td>

			<td><?php echo $mainCurrency.":".$itotalprice;?></td>
		 </tr>
		 <?
		}
		 ?><tr>
		 	<td colspan=8 align=left ><?php
		 	echo $TGQNote;	
		 	?></td>	
		 </tr>		
	</table>
		
	</div><!--航班信息显示结束-->
	<div style="text-align:center">
	<?php
		//echo '<input type="button" name="bbb" onclick="gotomyorder();" value="My order" />';
		if($orderstatus=="0")
		{
			echo '<input type="button" name="bbb" onclick="payorder();" value="Purchase" />';
		}
	?></div>	
	<div id="dvPrice" class="bookprice" style="margin-top:20px;width:100%;">
		total for <?php echo $TotalPassenger; ?> person(all taxes and fees includes):<?php echo $mainCurrency.":".$TotalPrice; ?>
	</div>
	<!--价格信息显示结束-->
	
	<div id="dvbook" style="padding-top:19px;width:100%;">
		<span class="tiptitle"><?=lang("PassengerInfomation")?></span>
		<?
		
		//国际机票
		if($cpsdata[0]->note2!="")
		{
		?>
		<table border=0 width=100% class="ordertable" bordercolor=#DFDFDF  id="tbPassenger_1">
			<?php
			foreach($cpsdata as $passenger)
			{
				$PI_info=json_decode($passenger->note2);
				
				?><tr height=30 align="center" >
					<td>
						<div style="background:#E9EBF1;padding:10px" >
						<table border=0  width=100% >
							<tr align=left height=28 >
								<td width=127 ><?=lang("book_Name")?>:&nbsp;&nbsp;</td>
								<td width=214 ><?=str_replace("/","&nbsp;",$PI_info->PassengerName);?></td>
								<td><?=lang("book_Gender")?>:&nbsp;&nbsp;</td>
								<td><?=$arGender[$PI_info->PI_userGender];?></td>
							</tr>
							
							<tr align=left height=28 >
								<td><?=lang("book_Nationality")?>:&nbsp;&nbsp;</td>
								<td><?php
									$national=explode("||",$PI_info->PI_userNationality);
									echo $national[0];
								?></td>
								<td><?=lang("book_Dateofbirth")?>:&nbsp;&nbsp;</td>
								<td><?=$PI_info->PI_userBirth;?></td>
							</tr>
							<tr align=left height=28 ><td><?=lang("book_IDType")?>:&nbsp;&nbsp;</td>
					                <td><?=$aridType[$PI_info->CTType];?></td>
					                <td><?=lang("book_IDNumber")?>:&nbsp;&nbsp;</td>
					                <td><?=$PI_info->CTID;?></td>
					          </tr>
					          
					          <tr align=left height=28 >
					                <td><?=lang("book_IDexpirationdate")?>:&nbsp;&nbsp;</td>
					                <td align=left><?=$PI_info->PI_idExpiration;?></td>
					                <td width=127 ><?=lang("book_Mobilephone")?>:&nbsp;&nbsp;</td>
								 <td width=214><?=$PI_info->PassengerTel;?></td>
					          </tr>
					           <tr align=left height=28 >
					                <td><?=lang("book_TicketNo")?>:&nbsp;&nbsp;</td>
					                <td colspan=3 align=left><?
										echo $passenger->HKID;
					                ?></td>
					          </tr>
							</table>
							</div>
							<div style="background:#fff;height:5px" ></div>
						
					</td>
				</tr><?php
			}
			?>
		</table>
		<?php
		}else
		{
		?>
		<table border=0 width=100% class="ordertable" bordercolor=#DFDFDF  id="tbPassenger_1">
			<tr height=30 class="booktitle"  >
				<th width=50><?=lang("book_Type")?></th>
				<th><?=lang("book_Name")?></th>
				<th><?=lang("book_IDType")?></th>
				<th><?=lang("book_IDNumber")?></th>
				<th><?=lang("book_Mobilephone")?></th>
				<th><?=lang("book_TicketNo")?></th>
			</tr>
			<?php
			foreach($cpsdata as $passenger)
			{
				//Type,Name,CertificateType,CTID,PPID
			
			?><tr height=30 align="center" >
				<td><?php echo $arPassType[$passenger->Type]; ?></td>
				<td><?php echo $passenger->Name; ?></td>
				<td><?php echo $aridType[$passenger->CertificateType]; ?></td>
				<td><?php echo $passenger->CTID; ?></td>
				<td><?php echo $passenger->PPID; ?></td>
				<td><?php echo $passenger->HKID; ?></td>
			</tr><?php
			}
			?>
		</table>
		<?php
		}
		?>
	</div>	
	
	<!--预订信息显示结束-->
	<div id="dvbook" style="padding-top:19px;width:100%;">
		<span class="tiptitle"><?=lang("ContactInfomation")?></span>
		<table border=0 style="width:100%;" class="contactable" bordercolor=#DFDFDF >
			<tr height=32 align=left >
				<td width=230 align=right ><?=lang("book_Name")?>:&nbsp;</td>
				<td width=215 ><?php echo $LinkMan?></td>
				<td width=275 ><div id="txLinkManTip"></div></td>
			</tr>
			
			<tr height=32>
				<td align=right ><?=lang("book_Mobilephone")?>1:&nbsp;</td>
				<td><?php echo $Mobile1?></td>
				<td><div id="txMobilephone1Tip"></div></td>
			</tr>
			
			<tr height=32>
				<td align=right><?=lang("book_Mobilephone")?>2:&nbsp;</td>
				<td><?php echo $Mobile2?></td>
				<td><div id="txMobilephone2Tip"></div></td>
			</tr>
			
			<tr height=32 >
				<td align=right>Email:&nbsp;</td>
				<td><?php echo $Email?></td>
				<td><div id="txEmailTip"></div></td>
			</tr>

		</table>
	</div>
	<!--联系信息显示结束
	<div  style="padding:19px;width:100%;">
		<span class="tiptitle">log Infomation</span>
		<table style="width:100%;" >
			<tr align="center">
				<th width=160 >Date</th>
				<th width=450 >Context</th>
				<th width=150>User</th>
			</tr>
			<?php
			foreach($loglist as $item)
			{
			?>
			<tr align="center" >
				<td><?=$item->OperDate ?></td>
				<td align="left" style="padding-left:10px"><?=$item->OperNote."<BR>".$item->Note ?></td>
				<td><?=$item->OperAccount;?></td>
			</tr>
			<?php
			}
			?>
		</table>
	</div>
</div>-->
<?php
	echo form_open("flyguam/dopayorder",array("id" => "formOrder"));
	echo form_hidden("Orderno",$sOrderno);
	
	echo form_close();
?>
<script language="javascript">
//支付订单
function payorder()
{
	if(confirm("Are You sure  want to pay the order"))
	{
		gd$("formOrder").submit();
	}
}
function gotomyorder()
{
	window.location="../queryorder";	
}
</script>

<?php $this->load->view('flyguam/_footer') ?>